<!-- 添加钥匙或者修改钥匙
    参数:
        type: 0 添加, 1修改
        id: 数据id
 -->
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>表单</title>
    <link rel="stylesheet" href="../../lib/weui/weui.min.css">
    <link rel="stylesheet" href="../../font/iconfont.css">
    <link rel="stylesheet" href="../../css/style.css">
</head>
<body>
    <div id="app">
        <div class="header" id="header">
            <div class="left-btn btn" @click="back"><span class="wjxfont icon-fanhui1" style="font-size: 20px;"></span></div>
            <div class="right-btn btn" @click="submit">完成</div>
            <div class="title" v-text="title">添加</div>
        </div>
        <div class="form">
            <div class="form-item">
                <div class="label"></div>
                <div class="input">
                    <input type="text" v-model="formData.account" placeholder="账号">
                </div>
            </div>
            <div class="form-item">
                <div class="label"></div>
                <div class="input">
                    <input type="text" v-model="formData.password" placeholder="密码">
                </div>
            </div>
            <div class="form-item">
                <div class="label"></div>
                <div class="input">
                    <input type="text" v-model="formData.tags" placeholder="多个标签以空格分割">
                </div>
            </div>
        </div>
        <!-- modal层 -->
        <!-- 加载进度条 -->
        <div :class="{hide: hideLoadingToast}">
            <div class="weui-mask_transparent"></div>
            <div class="weui-toast">
                <i class="weui-loading weui-icon_toast"></i>
                <p class="weui-toast__content">数据加载中</p>
            </div>
        </div>
        <!-- 错误提示警告框 -->
        <div :class="{hide: errorAlert.hideErrorAlert}">
            <div class="weui-mask"></div>
            <div class="weui-dialog">
                <div class="weui-dialog__hd"><strong class="weui-dialog__title">错误</strong></div>
                <div class="weui-dialog__bd">{{errorAlert.errMsg}}</div>
                <div class="weui-dialog__ft">
                    <a @click="hideAlert" class="weui-dialog__btn weui-dialog__btn_primary">确定</a>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<!-- lib -->
<script src="../../lib/vue/vue.min.js"></script>
<script src="../../lib/zepto/zepto.min.js"></script>

<!-- util -->
<script src="../../util/mm.js"></script>

<script src="../../script/constants.js"></script>

<!-- service -->
<script src="../../script/service/key-service.js"></script>

<script src="./key-form.js"></script>